<?php
    //建立数据库连接
    include("../inc/dbconn.php");
    $number=$_POST["number"];
    $name = $_POST["name"];
    $sex=$_POST["sex"];
    $role=$_POST["role"];
    $department=$_POST["department"];
    $email=$_POST["email"];
    $tel = $_POST["tel"];
    $date = $_POST["date"];

    $sql = "update users set name='$name',tel='$tel',sex='$sex',role='$role',department='$department',email='$email',number='$number',date='$date'";

    if ($conn->query($sql) ===true){
        $data["code"] = 3000;
        $data["msg"] = "修改成功";
    }else{
        $data["code"] = 3001;
        $data["msg"] = "修改失败";
    }
    echo json_encode($data);
?>